﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using DataAccess;


public partial class AdminCP_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        InfoDangNhap dn=(InfoDangNhap)Session["login"];
        if (dn!=null)
        {
            QuanTri();
        }
        else
	    {
             Response.Redirect("~/Login.aspx");   
	    }
                   
     
    }
    public void QuanTri()
    {
        string module = null;

        if (!IsPostBack)
        {
            Control ct = null;
            module = Request.QueryString["mod"];
            HtmlGenericControl gel = new HtmlGenericControl("div");
            if (module == null)
            {
                ct = Page.LoadControl("~/Controls/DeTaiKhoaLuan.ascx");
            }
            else
                if (module == "giaoVien")
                {
                    ct = Page.LoadControl("~/Controls/AdminGiaoVien.ascx");
                }
                else
                    if (module == "sinhVien")
                    {
                        ct = Page.LoadControl("~/Controls/AdminSinhVien.ascx");
                    }
                    else
                        if (module == "dangKy")
                        {
                            ct = Page.LoadControl("~/Controls/AdminDangKyDeTaiKhoaLuan.ascx");
                        }
                        else
                            if (module == "hocKy")
                            {
                                ct = Page.LoadControl("~/Controls/AdminHocKy.ascx");
                            }
                            else
                                if (module == "khoaHoc")
                                {
                                    ct = Page.LoadControl("~/Controls/AdminHocKy.ascx");
                                }
            //    else
            //    {
            //        ct = Page.LoadControl("Controls/Products.ascx");
            //    }
            gel.Controls.Add(ct);
            Panel2.Controls.Add(gel);
        }
    }
}